import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router"

const routes: RouteRecordRaw[] = [
  {
    path: "/",
    name: "main",
    component: () => import("@/views/main/index.vue"),
  },
]

const router = createRouter({ history: createWebHashHistory(), routes })

router.beforeEach((to, from, next) => {
  // if (to.path !== "/login" && to.path !== "/register") {
  //   if (sessionStorage.getItem("token")) {
  //     next()
  //   } else {
  //     next("/login")
  //   }
  // } else {
  next()
  // }
})
export default router
